package com.example.cloud_bus_config_consumer.controller;

import com.example.cloud_bus_config_consumer.feigen.ProviderFeign;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/consumer")
public class ConsumerController {

    @Autowired
    private ProviderFeign providerFeign;

    @Value("${file.path}")
    private String filePath;

    @RequestMapping("/method")
    public String method() {
        System.out.println(filePath);
        return filePath;
    }

    @RequestMapping("/getProvider")
    public String getProvider() {
        String method = providerFeign.method();
        System.out.println(method);
        return method;
    }

    @RequestMapping("/getProvider2")
    public String getProvider2() {
        String method = providerFeign.method2("66669999");
        System.out.println(method);
        return method;
    }
}
